// 定义路由表

// 路由表: 其实就是一个数组,数组里面存储了对象.每一个对象就是一条路由规则
import React from 'react'
const Home = React.lazy(() => import('../pages/Home'))
const About = React.lazy(() => import('../pages/About'))
const Message = React.lazy(() => import('../pages/Message'))
const News = React.lazy(() => import('../pages/News'))
const Detail = React.lazy(() => import('../pages/Detail'))
export default [
  { path: '/', component: Home, exact: true },

  {
    path: '/home',
    component: Home,
    children: [
      {
        path: '/home/news',
        component: News,
      },
      {
        path: '/home/message',
        component: Message,
        children: [
          {
            path: '/home/message/detail/:id',
            component: Detail,
          },
        ],
      },
    ],
  },
  {
    path: '/about',
    component: About,
  },
]
